<template>
  <el-card class="progress-box">
    <div class="time-line flex padding-tb-sm ">
      <div
        v-for="(item, index) in activities"
        :key="index"
        class="text-center flex-sub tiem-line-item pointer text-cut"
        :class="{ 'text-gray': !item.state }"
      >
        <div class="text-cut">{{ item.content }}</div>
        <div class="margin-top-lg text-cut">{{ item.timestamp }}</div>
      </div>
    </div>
  </el-card>
</template>

<script>
export default {
  data() {
    return {
      activities: [
        {
          content: '已确认',
          timestamp: '2018-04-13',
          state: true
        },
        {
          content: '已审批',
          timestamp: '2018-04-11',
          state: true
        },
        {
          content: '已退货',
          timestamp: '2018-04-11',
          state: true
        },
        {
          content: '待入仓',
          timestamp: '2018-04-11',
          state: false
        },
        {
          content: '待处理',
          timestamp: '2018-04-11',
          state: false
        },
        {
          content: '处理中',
          timestamp: '2018-04-11',
          state: true
        },
        {
          content: '待出仓',
          timestamp: '2018-04-11',
          state: false
        },
        {
          content: '待签收',
          timestamp: '2018-04-11',
          state: false
        },
        {
          content: '待完成',
          timestamp: '2018-04-11',
          state: false
        },
        {
          content: '待锁单',
          timestamp: '2018-04-11',
          state: false
        },
        {
          content: '待关闭',
          timestamp: '2018-04-11',
          state: false
        }
      ]
    }
  }
}
</script>

<style lang="scss" scoped>
.progress-box {
  margin: 0 0 15px;
}

.tiem-line-item {
  position: relative;
  &::before {
    content: '';
    position: absolute;
    top: calc(50% - 1px);
    left: 0%;
    border-top: 2px solid #43c9a2;
    width: 100%;
  }
  &::after {
    content: '';
    position: absolute;
    top: calc(50% - 6px);
    left: calc(50% - 6px);
    border-radius: 50%;
    width: 12px;
    height: 12px;
    background: #43c9a2;
  }
}

.text-gray.tiem-line-item {
  &::before {
    border-top: 2px solid #94a0b3;
  }
  &::after {
    background: #94a0b3;
  }
}

.tracking-head {
  padding-left: 68px;
  font-size: 12px;
  font-weight: bold;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid #94a0b3;
}

.tab-lable {
  color: #94a0b3;
}
</style>
